import 'PicUrl.dart';
import 'Tips.dart';

class CookStep {
    String? content;
    String? duration;
    String? id;
    List<PicUrl>? pic_urls;
    Tips? tips;
    String? title;

    CookStep({this.content, this.duration, this.id, this.pic_urls, this.tips, this.title});

    factory CookStep.fromJson(Map<String, dynamic> json) {
        return CookStep(
            content: json['content'], 
            duration: json['duration'], 
            id: json['id'], 
            pic_urls: json['pic_urls'] != null ? (json['pic_urls'] as List).map((i) => PicUrl.fromJson(i)).toList() : null, 
            tips: json['tips'] != null ? Tips.fromJson(json['tips']) : null, 
            title: json['title'], 
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data['content'] = this.content;
        data['duration'] = this.duration;
        data['id'] = this.id;
        data['title'] = this.title;
        if (this.pic_urls != null) {
            data['pic_urls'] = this.pic_urls!.map((v) => v.toJson()).toList();
        }
        if (this.tips != null) {
            data['tips'] = this.tips!.toJson();
        }
        return data;
    }
}